package 强化训练;

import java.util.Scanner;

public class day15整数二进制中1的个数 {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        while(sc.hasNext()){
            int num = sc.nextInt();
            System.out.println(toBinary(num));
        }
    }
    public static int toBinary(int num){
        StringBuilder ret = new StringBuilder();
        int count = 0;
        while(num != 0){
            int i = num % 2;
            if(i == 1) count++;
            num /= 2;
        }
        return count;
    }
}
